Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

same70b: Add support for SMC for SAME70-series #78120

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AsgeirSH
Copy link

@AsgeirSH AsgeirSH commented Sep 6, 2024

The Static Memory Controller driver (which is already implemented for SAM4S in the existing memc) is not enabled for SAME70, nor does it support the 16-bit memory width of that SMC. This PR (with the accompanying one in hal_atmel) adds this support.

Tested on a custom board, and tests for SAM4S build locally (tests/drivers/memc/ram).

  • Add smc definition in same70.dtsi.
  • Add atmel,smc-bus-width to atmel,sam-smc dts bindings. Update driver to select bus width from DT.

Copy link

github-actions bot commented Sep 6, 2024

Hello @AsgeirSH, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

@zephyrbot
Copy link
Collaborator

The following west manifest projects have been modified in this Pull Request:

Name Old Revision New Revision Diff
hal_atmel zephyrproject-rtos/hal_atmel@56d60eb (master) zephyrproject-rtos/hal_atmel#41 zephyrproject-rtos/hal_atmel#41/files

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@zephyrbot zephyrbot added manifest manifest-hal_atmel DNM This PR should not be merged (Do Not Merge) labels Sep 6, 2024
@AsgeirSH AsgeirSH force-pushed the same70/smc-support branch 2 times, most recently from ccdd7ab to fb00921 Compare September 8, 2024 19:35
Comment on lines 78 to 80
#if defined(CONFIG_SOC_SERIES_SAME70) || defined(CONFIG_SOC_SERIES_SAMV71)
#define BUS_WIDTH(node_id) COND_CODE_1(DT_ENUM_IDX(node_id, atmel_smc_bus_width), \
(SMC_MODE_DBW_16_BIT), (SMC_MODE_DBW_8_BIT))
#else
#define BUS_WIDTH(node_id) (0)
#endif

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-#if defined(CONFIG_SOC_SERIES_SAME70) || defined(CONFIG_SOC_SERIES_SAMV71)
-	#define BUS_WIDTH(node_id) COND_CODE_1(DT_ENUM_IDX(node_id, atmel_smc_bus_width), \
-	(SMC_MODE_DBW_16_BIT), (SMC_MODE_DBW_8_BIT))
-#else
-	#define BUS_WIDTH(node_id) (0)
-#endif
+#define BUS_WIDTH(node_id) COND_CODE_1(DT_ENUM_IDX(node_id, atmel_smc_bus_width), \
+			    (SMC_MODE_DBW_16_BIT), (0))

Bus Width configuration for the External Bus Interface / the
Static Memory Controller that is wired to the external device.
SMC on SAME70 (and S70/V70/V71) supports 8- or 16-bit bus width.
On SAM4S (and 4E) only 8-bit data buses are supported, therefore 8-bit is set as default.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

        Bus Width configuration for the External Bus Interface. The
        Static Memory Controller that is wired to the external device.
        SMC on SAMx7 supports 8/16-bit bus width and on SAM4 only
        8-bit data bus is supported.

        The default value is 8-bit data buses.

Add smc definition in same70.dtsi
Add atmel,smc-bus-width to atmel,sam-smc dts bindings.
Update driver to select bus width from DT

Signed-off-by: Asgeir Stavik Hustad <[email protected]>
@nandojve nandojve added this to the v4.0.0 milestone Sep 10, 2024
@mmahadevan108 mmahadevan108 modified the milestones: v4.0.0, v4.1.0 Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: MEMC DNM This PR should not be merged (Do Not Merge) manifest manifest-hal_atmel platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants